se5210fandomcom-20200214-history
Selenium testing and learning process.
Selenium is a software testing framework for certain web applications that provides a record/playback tool for authoring tests without learning a testing language. Selenium IDE is basically Selenium with a lot more functions. Selenium testing and learning process. IMPORTANT! Use Selenium IDE or else it won't work. Bug alert: At the time the online document was writen, there’s a bug, where at times, when the IDE is first opened and then you select File=>Open, nothing happens. If you see this, close down the IDE and restart it (you don’t need to close the browser itself). This will fix the problem. Can be downloaded here: *http://seleniumhq.org/download/ Basic details found here: *http://seleniumhq.org/projects/ide/ *http://seleniumhq.org/about/how.html Online documentation: h *http://seleniumhq.org/docs/ *http://release.seleniumhq.org/selenium-core/1.0/reference.html Getting started After downloading and installing Selenium IDE, you activate it by going to the firefox tools menu, (note you may have to restart firefox first). This should open a new menu that allows you to use Selenium. The menu is in Html by default, but can be changed to a nother programing language in the options menu and going to format. I recomend that you read the online guide for Selenium IDE before moving on, it can be found here: (http://seleniumhq.org/docs/03_selenium_ide.html). If you want to get started right away, then I would recomend using the record mode which should be on by default, (see below image for what it looks like when on), then commands will appear in the menu as you use firefox. On the right you should see a picture of the pop-up menu that is created when you start the Selenium program. when you open it, the box's will be empty. As you use your web browser, the box's will fill up and you can use the button's in the bar to go back over the things you have done, either one at a time or all at once, in order to gain more information. Basic How to: To Change Sel from html to Perl, open the options menu, go to format and select Perl. Please note, you will not be able to run tests in this mode it simply converts the test's into the chosen language. The Toolbar: * The bar lets you control the speed at which the IDE runs through the tests. * The sideways triangle with three bold green bars next to it runs through all the tests from start to finish. * The Sideways triangle with a single bold green bar next to it runs the selected test. * The two gold bars represent the pause button. * The blue arrow lets you step through the tasks you are running through. Note, can only be used when the program is paused. * The green triangle in a box activates the TestRunner Mode and you must have Selenium-Core TestRunner loaded into your web browser in order to use it, this means we are unlikly to use it. * The purple spiral applys the advanced rollup rules, this allows you to group repetitive Selenium command sequences. At the time of writing I am unsure of how to make this work. * The Edit button: this contains some basic features, cut, copy, delete, etc. Along with the short cut keys for them. * The Options button: the options inside the options lets you add extentions, change the default timeout and a few other things. Format allows you to change the programing language that the commands are written in. Commands/Tests: The tools: * The table tab shows you all the commands and comments that have been recorded and/or written by the user. Note this can only be used in HTML format. *The source tab shows you the source code for the current format. *The Log tab, below the table, shows you what the Selenium program has done or is doing, including any errors that pop up. *The Reference tab gives you a summery of what the command does for the selected test. A detailed list of commands, and what they do, is avalible here: http://release.seleniumhq.org/selenium-core/1.0/reference.html *At the time of writing I am unsure what the UI-Element and the Rollup tabs do. Writing tests: *Writing tests/commands is pretty simple, just right click in the command box and select Insert New Command and then select the action you want from the command list. *Then you must type in the target of your command, this can be a webpage for an open command, or a search_field for a type command. *Last is adding the Value, now this is not needed for a number of commands but is needed for some others, for example, if you are opening a webpage, then you can leave he Value box blank, but if you are using a search_field, then you must put the search term in the Value box. *Warning, If you want to have white space then use comments, because if you have blank commands when you run the tests then Selenium will have problems. Category:Team Slackers pages Category:Guides